using System;
using System.IO;
using System.Xml;
using System.Collections;
using System.Windows.Forms;

namespace PointOfSale.Languages
{
	public class Language
	{
		public Language()
		{
		}
		public static Hashtable GetData(String filename)
		{
			Hashtable table = new Hashtable();
			try
			{
				XmlTextReader reader = new XmlTextReader (filename);
				String attribute = "";
				String textValue = "";
				while(reader.Read())
				{
					if(reader.HasAttributes)
					{
						reader.MoveToAttribute(0);
						attribute = reader.Value;
					
					}
					switch(reader.NodeType)
					{
						case XmlNodeType.Text:
							textValue = reader.Value;
							break;
					}
					if(attribute != "" & textValue != "")
					{
						table.Add(attribute, textValue);
						attribute = "";
						textValue = "";
					}
				}
			}
			catch(Exception exp)
			{
				MessageBox.Show(exp.ToString());
			}
			return table;
		}
	}
}
